import Vue from 'vue'
import VueRouter from 'vue-router'

// const Login = () => import('../views/About.vue')
const Login = () => import('../views/Login.vue')
const Index = () => import('../views/Index.vue')
const welcome = () => import('../views/Welcome.vue')
const stores = () => import('../components/stores/stores.vue')
const userinfo = () => import('../components/userinfo/userinfo.vue')
const staffs = () => import('../components/staffs/staffs.vue')
const repairs = () => import('../components/repairs/repairs.vue')
const questions = () => import('../components/questions/questions.vue')
const news = () => import('../components/news/news.vue')
const building = () => import('../components/building/building.vue')
const administrator = () => import('../components/administrator/administrator.vue')
const house = () => import('../components/house/house.vue')
const administratorrole = () => import('../components/administratorrole/administratorrole.vue')
const fee = () => import('../views/Fee')
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login,
  },
  {
    path: '/Index',
    redirect:"/welcome",
	// name: 'Home',
	component: Index,
	meta:{
		requiresAuth:true
	},
    children:[
      {
        path: '/userinfo',
		meta:{
			requiresAuth:true
		},
        component: userinfo
      },
	  {
        path: '/repairs',
		meta:{
			requiresAuth:true
		},
        component: repairs
      },
	  {
        path: '/questions',
		meta:{
			requiresAuth:true
		},
        component: questions
      },
	  {
        path: '/stores',
		meta:{
			requiresAuth:true
		},
        component: stores
      },
	  {
        path: '/building',
		meta:{
			requiresAuth:true
		},
        component: building
      },  {
        path: '/welcome',
		meta:{
			requiresAuth:true
		},
        component: welcome
      },
	  {
	    path: '/news',
		meta:{
			requiresAuth:true
		},
	    component: news
	  },
	  {
	    path: '/staffs',
		meta:{
			requiresAuth:true
		},
	    component: staffs
	  },
	  {
	    path: '/administrator',
		meta:{
			requiresAuth:true
		},
	    component: administrator
	  },
	  {
	    path: '/fee',
		meta:{
			requiresAuth:true
		},
	    component: fee
	  },
	  {
	    path: '/house',
		meta:{
			requiresAuth:true
		},
	    component: house
	  },
	  {
	    path: '/administratorrole',
		meta:{
			requiresAuth:true
		},
	    component: administratorrole
	  }
	 ],
}]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
